package quirk;

/**
 * A WORD as defined by QUIRK's grammar.
 * @author Andrew Bernard
 */
public class AtomWord extends Atom {
  public AtomWord(String value, int operator) {
    super(value, operator);
  }

  public boolean evaluate(QueryWord[] mapping) {
    boolean evaluatedAtom = false;
    for (int i = 0; i < mapping.length; i++) {
      if (mapping[i].equals(getAtomValue())) {
        evaluatedAtom = mapping[i].isInLine();
        break;
      }
    }
    return evaluatedAtom;
  }
}
